﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DelegateApp1
{
    public partial class FrmChild : Form
    {
        public FrmChild(int num)
        {
            InitializeComponent();
            this.Text += $"[{num}]";
        }


        //【3】创建委托变量
        public Action<string> ChildReceive { get; set; }

        private void button1_Click(object sender, EventArgs e)
        {
            //【5】使用委托变量
            ChildReceive(this.txt_SendMsg.Text);
        }
    }
}
